﻿using System;
using System.Collections.Generic;
using System.Linq;
using Sumen.Model.Model;

namespace Sumen.Business.Presenter.Sys
{
    public class SysErrorPresenter
    {
        private sumenEntitiesSystem _sumenEntitiesSystem;

        public SysErrorPresenter(sumenEntitiesSystem pContext)
        {
            _sumenEntitiesSystem = pContext;
        }

        public int Add(object pObjectValue)
        {
            sys_error newError = (sys_error)pObjectValue;
            _sumenEntitiesSystem.sys_error.Add(newError);
            return _sumenEntitiesSystem.SaveChanges();
        }

        public ICollection<sys_error> GetAll()
        {
            return _sumenEntitiesSystem.sys_error.ToList();
        }

    }
}
